local skill = fk.CreateSkill{
  name = "action__younantongdang_ol_skill",
}

Fk:loadTranslationTable{
  ["action__younantongdang_ol"] = "有难同当",
  ["action__younantongdang_ol_skill"] = "有难同当",
  [":action__younantongdang_ol"] = "锦囊牌<br /><b>时机</b>：出牌阶段<br /><b>目标</b>：所有未处于连环状态的角色 <br /><b>效果</b>：目标角色进入连环状态。",
  ["#action__younantongdang_ol_skill"] = "令所有未处于连环状态的角色进入连环状态",
}


skill:addEffect("cardskill", {
  mute = true,
  name = "action__younantongdang_ol",
  prompt = "#action__younantongdang_ol_skill",
  mod_target_filter = function(self, player, to_select, selected, card, distance_limited)
    return not to_select.chained
  end,
  can_use = function(self, player, card)
    return not player:isProhibited(player, card)
  end,
  on_use = function(self, room, cardUseEvent)
    local targets = {}
    for _, p in ipairs(room:getAlivePlayers()) do
      if not p.chained then
        table.insert(targets, p)
      end
    end
    if not cardUseEvent.tos or #cardUseEvent.tos == 0 then
      cardUseEvent.tos = targets
    end
  end,
  on_effect = function(self, room, effect)
    effect.to:setChainState(true)
  end,
})


return skill